package velox.jcr.mapper.loader;

import javax.jcr.Node;
import javax.jcr.RepositoryException;

import velox.jcr.mapper.CachingLoader;
import velox.jcr.mapper.UnitOfWorkHolder;

public class GrandParentLoader extends CachingLoader<String> {

	@Override
	public String doLoad(String uuid) throws RepositoryException {
		Node node = UnitOfWorkHolder.get().getMapperManager().getSession().getNodeByUUID(uuid);
		return node.getParent().getParent().getUUID();
	}
}
